<%--
 *  File:    ProductSelectPop.jsp
 *  @Author: Kevinfan
 *  Date:    4/11/2011
 *
 *  Copyright (C) 2000 - 2012 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only spc] skipping /oval/in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%
  //init param
  String privilegeCode = "ALL";
  String strTableName = "ovproductsummary";
  String strModuleName = "COM";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc"%>
<%@ include file="/inc/OvalLocationDefault.inc"%>

<html>
<head>
<title>Product Select</title>
<PageFlow:CheckPageFlow pageName="p_proudctsummary" />
<%@ include file="/inc/CatchError.inc"%>
<%@ include file="/inc/SumDiv.inc"%>

<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link rel="stylesheet"
	href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css"
	type="text/css">
<script language="JavaScript"
	src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/PopWindow.js"></script>
<script type="text/javascript" src="<%=contextPath%>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<%=contextPath%>/js/artDialog/artDialog.source.js?skin=default"></script>
<script type="text/javascript" src="<%=contextPath%>/js/artDialog/plugins/iframeTools.source.js"></script>
<script language="JavaScript">

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "ProdSelectPopNew.jsp?maxitem=10&<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function clickRow(id,code,name,price,spec)
{
  parent.page_setProduct(id,code,name,price,spec);
  artDialog.close();
}

</script>
</head>
<body>
<%
Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
if(totalsummary == null) totalsummary = new Vector();  
%>
<% //--------------------------------------  hidden form variant --%>
<form name="cform" method="post" action="../Dispatcher" target="_self">
<input type="hidden" name="pagename" value="p_proudctsummary"> <input
	type="hidden" name="actionname"> <input type="hidden"
	name="returnvalue" value="<%=request.getParameter("returnvalue") %>"> 
	<custom:hidden property="hospitaldeptid"></custom:hidden>
	<custom:hidden property="hospitalid"></custom:hidden>
	<custom:hidden property="orgid"></custom:hidden>
	<custom:hidden property="year"></custom:hidden>
	<custom:hidden property="month"></custom:hidden>
	<custom:hidden property="doctorid"></custom:hidden>
	<custom:hidden property="mflag"/>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
	<tr>
	    <td valign="top">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
		</table>
		<table width="100%" border="0" cellspacing="0">
			<%@ include file="/inc/SummarySearch.inc"%>
		</table>
		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
			<tr class="deepblue-left">
			    <td class="title_center" width="1%">&nbsp;</td>
				<td class="title_center" width="25%">&nbsp;<a href="javascript:page_summary('orderby','prodcode')"><%=label.getLabelName("L_Code")%></a></td>
    	   		<td class="title_center" width="49%">&nbsp;<a href="javascript:page_summary('orderby','prodname')"><%=label.getLabelName("L_Name")%></a></td>
            </tr>
            <%
	        int i = 0;
	        String strIsChecked = new String("Checked");
	        String strClassType = new String();   
     		%>
			<logic:iterate id="org" collection="<%=totalsummary %>">

			<%
		       HashMap orgMap = (HashMap)pageContext.getAttribute("org"); 
		       if(i%2 == 1)
		       {
		         strClassType = "td-listrom";
		       }else{                    
		         strClassType = "";
		       }
		       if(i != 0)
		       {          
		         strIsChecked = "";
		       }
		       else
		       {
		       }  
		              
		       i++;        
    		 %>
				<tr onmouseover="this.className='tr-over'"
					onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'"
					class="<%=JspHelper.filterNull(strClassType)%>"
					onClick="javascript:radiotrue('selectItem<%=JspHelper.filterNull( i )%>');
                             clickRow('<%=JspHelper.filterNull( orgMap.get("prodid") )%>', '<%= OvalTools.replaceQuot(orgMap.get("prodcode")) %>','<%= OvalTools.replaceQuot(orgMap.get("prodname")) %>','<%=OvalTools.replaceQuot(orgMap.get("unitprice"))%>','<%=OvalTools.replaceQuot(orgMap.get("spec"))%>')">
					<td><input id="selectItem<%=JspHelper.filterNull( i )%>"
						type="radio" name="selectOrg" class="normalradio"
						value="<%=JspHelper.filterNull( orgMap.get("prodid") )%>"
						<%=JspHelper.filterNull( strIsChecked )%>></td>
					<td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( orgMap.get("prodcode") )%></td>
					<td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( orgMap.get("prodname") )%></td>
				</tr>
			</logic:iterate>
			<%@ include file="/inc/SummaryActionPop.inc"%>
		</table>
		</td>
	</tr>
</table>
</body>
</html>
